<?php
/* -------------------------------------------------------------------------------------
* 	ID:						$Id: customer_memo.php 11 2013-09-21 11:43:11Z phone.mueller@googlemail.com $
* 	Letzter Stand:			$Revision: 11 $
* 	zuletzt geaendert von:	$Author: siekiera $
* 	Datum:					$Date: 2013-09-21 11:43:11 +0000 (Sat, 21 Sep 2013) $
*
* 	SEO:mercari by Siekiera Media
* 	http://www.seo-mercari.de
*
* 	Copyright (c) since 2011 SEO:mercari
* --------------------------------------------------------------------------------------
* 	based on:
* 	(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)
* 	(c) 2002-2003 osCommerce - www.oscommerce.com
* 	(c) 2003     nextcommerce - www.nextcommerce.org
* 	(c) 2005     xt:Commerce - www.xt-commerce.com
*
* 	Released under the GNU General Public License
* ----------------------------------------------------------------------------------- */

defined( '_VALID_XTC' ) or die( 'Direct Access to this location is not allowed.' ); ?>

<td valign="top" class="main"><?php echo ENTRY_MEMO; ?></td>
<td class="main">
	<?php
	  $memo_values = $db->db_query("SELECT
		                                  *
		                              FROM
		                                  " . TABLE_CUSTOMERS_MEMO . "
		                              WHERE
		                                  customers_id = '" . $_GET['cID'] . "'
		                              ORDER BY
		                                  memo_date DESC");
  while(!$memo_values->EOF) {
    $poster_values = $db->db_query("SELECT customers_firstname, customers_lastname FROM " . TABLE_CUSTOMERS . " WHERE customers_id = '" . $memo_values->fields['poster_id'] . "'");
?><table width="100%">
      <tr>
        <td class="main"><b><?php echo TEXT_DATE; ?></b>:<i><?php echo $memo_values->fields['memo_date']; ?></i><b><?php echo TEXT_TITLE; ?></b>:<?php echo $memo_values->fields['memo_title']; ?><b>  <?php echo TEXT_POSTER; ?></b>:<?php echo $poster_values->fields['customers_lastname']; ?> <?php echo $poster_values->fields['customers_firstname']; ?></td>
      </tr>
      <tr>
        <td width="142" class="main" style="border: 1px solid; border-color: #cccccc;"><?php echo $memo_values->fields['memo_text']; ?></td>
      </tr>
      <tr>
        <td><a href="<?php echo href_link(FILENAME_CUSTOMERS, 'cID=' . $_GET['cID'] . '&action=edit&special=remove_memo&mID=' . $memo_values->fields['memo_id']); ?>" onClick="return confirm('<?php echo DELETE_ENTRY; ?>')"><input type="submit" class="button" value="<?php echo BUTTON_DELETE; ?>"></a></td>
      </tr>
    </table>
<?php
	$memo_values->MoveNext();
  }
?>
    <table width="100%">
      <tr>
        <td class="main" style="border-top: 1px solid; border-color: #cccccc;"><b><?php echo TEXT_TITLE ?></b>:<?php echo draw_input_field('memo_title'); ?><br><?php echo draw_textarea_field('memo_text', 'soft', '80', '5'); ?><br><input type="submit" class="button" value="<?php echo BUTTON_INSERT; ?>"></td>
      </tr>
    </table></td>